<%--
  Created by IntelliJ IDEA.
  User: 42890
  Date: 2020/3/15
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%--此页面主要联系request.getParameter()和request.getParameterValues()--%>
<head>
    <title>基本资料提交</title>
</head>
<body>
<form action="tijiao.jsp" method="post" name="frm"/>
<div align="center"><font size="6">基本资料</font>
<table width="700" cols="2" border="1">
    <tr>
        <td><font color="#d2691e" size="2">姓名：</font></td>
        <td><input type="text" size="18" name="name"></td>
    </tr>
    <tr>
        <td><font color="blue" size="2">性别：</font></td>
        <td><input type="radio" name="rdo" value="先生" checked>
            <font size="3">男</font>
            <input type="radio" name="rdo" value="女士"><font size="3">女</font>
        </td>
    </tr>
    <tr>
        <td><font size="2" color="#dc143c">民族:</font></td>
        <td><input type="radio" name="rdo1" value="汉族" checked><font size="3">汉族</font></td>
    </tr>
<tr>
    <td align="left"><font color="#dc143c" size="2">出生日期：</font></td>
    <td><input type="text" size="4" name="year">年
        <select name="month">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
        </select>月
        <select name="day">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
        </select>日
    </td>
</tr>
    <tr>
        <td><font size="2">兴趣爱好：</font></td>
        <td width="50%">
            <input type="checkbox" name="ckbx" value="电影">电影
            <input type="checkbox" name="ckbx" value="戏剧">戏剧
            <input type="checkbox" name="ckbx" value="音乐">音乐
            <input type="checkbox" name="ckbx" value="唱歌">唱歌</td>
    </tr>
</table>
    <input type="submit" value="提交" name="submit">
</form>
</div>
<div align="center">
    <%request.setCharacterEncoding("UTF-8");%>
    你填写的信息如下：<br>
    姓名：<%=request.getParameter("name")%><br><%--得到文本框中的name，获取文本框中的内容靠name来获取--%>
    性别：<%=request.getParameter("rdo")%><br>
    民族：<%=request.getParameter("rdo1")%>
    出生日期：<%=request.getParameter("year")%>年
    <%=request.getParameter("month")%>月
    <%=request.getParameter("day")%>日
    <br>
    兴趣爱好：<%String checked[]=request.getParameterValues("ckbx");
     if (checked!=null)
     {
         for (int i=0;i<checked.length;i++)
         {
             out.print(checked[i]+",");
         }
     }%>
</div>>
</body>
</html>
